import java.util.Random;

public class Deamon extends Thread {

	public Deamon() {
	}

	/** */
	/**
	 * A Deamon thread that change the key every 30 min.
	 */
	public void run() {

		String alphabet = new String(
				"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); // 9
		int length = alphabet.length(); // 10
		String result = new String();
		Random r = new Random(); // 11

		while (true) {
			try {
				result = "";
				for (int i = 0; i < 20; i++)
					// 12
					result = result + alphabet.charAt(r.nextInt(length)); // 13

				Entry.key = result;

				this.sleep(1000000);

			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}
	}
}
